package com.atguigu.day03.homework;

import java.util.Scanner;

public class HomeWork15 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入年份:");
        int year = sc.nextInt();
        System.out.println("请输入月份:");
        int month = sc.nextInt();
        System.out.println("请输入日期:");
        int day = sc.nextInt();
        int days = 0;

        if (year > 0) {

            if (month > 0 && month < 12) {

                if (month == 2) {
                    if (year % 4 == 0 && year % 100 != 0 && year % 400 == 0) {
                        if (day > 0 && day <= 29) {
                        } else {
                            System.out.println("日期格式出现错误");
                            return;
                        }
                    } else {
                        if (day > 0 && day <= 28) {
                        } else {
                            System.out.println("日期格式出现错误");
                            return;
                        }
                    }

                } else if (month == 4 || month == 6 || month == 9 || month == 11) {
                    if (day > 0 && day < 30) {

                    } else {
                        System.out.println("日期格式出现问题");
                        return;
                    }
                } else {
                    if (day > 0 && day < 31) {

                    } else {
                        System.out.println("日期格式出现问题");
                        return;
                    }
                }
            } else {
                System.out.println("月份格式出现问题");
                return;
            }
        } else {
            System.out.println("年份格式出现问题");
            return;
        }
        switch (month) {
            case 12:
                days += 30;
            case 11:
                days += 31;
            case 10:
                days += 30;
            case 9:
                days += 31;
            case 8:
                days += 31;
            case 7:
                days += 30;
            case 6:
                days += 31;
            case 5:
                days += 30;
            case 4:
                days += 31;
            case 3:
                days += 28;
                if (year % 400 == 0 || year % 4 == 0 && year % 100 != 0) {
                    days++;
                }
            case 2:
                days += 31;
            case 1:
                days += day;
        }
        System.out.println("今年已经过了" + days + "天了, 是去打鱼还是晒网呢");
        System.out.println((days % 5 <= 3) ? "今天还是安安分分的出门打鱼吧" : "终于可以休息了,晒上两天网");
    }
}
